<template>
  <div class="system">
    <el-container>
      <el-header
        >小好书商品管理系统
        <span>
          欢迎：{{ $store.state.username }}
          <a href="javascript:;" @click="handleToOut" class="loginOut">退出登录</a></span >
      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu
            router
            :default-active="$route.path"
            class="el-menu-vertical-demo"
          >
            <el-menu-item index="/admin/postedit">
              <i class="el-icon-menu"></i>
              <span slot="title">商品管理</span>
            </el-menu-item>

            <el-menu-item index="/admin/postadd">
              <i class="el-icon-edit"></i>
              <span slot="title">商品添加</span>
            </el-menu-item>

            <el-menu-item index="/admin/finduser">
              <i class="el-icon-user"></i>
              <span slot="title">用户列表</span>
            </el-menu-item>

            <el-menu-item index="/admin/searchuser">
              <i class="el-icon-zoom-in"></i>
              <span slot="title">查询用户</span>
            </el-menu-item>

            <el-menu-item index="/admin/sendmsg">
              <i class="el-icon-tickets"></i>
              <span slot="title">公告发送</span>
            </el-menu-item>
          </el-menu>
        </el-aside>

        <el-main>
         
          <router-view></router-view>
      
        </el-main>
        
      </el-container>
    </el-container>
  </div>
</template>
<script>
export default {
  data() {
    return {};
  },
  methods: {
    handleToOut() {
      localStorage.removeItem("token");
      this.$router.push("/login");
    },
  },
};
</script>

<style lang="scss" scoped>
* {
  padding: 0;
  margin: 0;
}
a{
  text-decoration: none;
}
.system {
  width: 100%;
  height: 100%;
}
.el-header {
  padding: 0 20px;
  background-color: rgb(119, 113, 113);
  color: rgb( 233,114,112);
  font-weight: bold;
  line-height: 60px;
}

.el-aside {
  background-color: #eee;
  color: #fff;
  text-align: center;
  line-height: 200px;
  margin-bottom: -9999px;
  padding-bottom: 9999px;
}

.el-main {
  // background-color: #e9eef3;
  background: url(https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1562044649,2196438801&fm=11&gp=0.jpg)
    repeat-y;
  background-size: 100%;
  color: #fff;
  text-align: center;
  // line-height: 160px;
  margin-bottom: -9999px;
  padding-bottom: 9999px;
  padding: 20px;
}
.adminName {
  float: right;
  margin-right: 20px;
  font-size: 14px;
}
.el-header {
  float: left;
  span {
    font-weight: normal;
    float: right;
    margin: 0 20px;
  }
}
.loginOut{
  color: white;
  margin-left: 20px;
}
</style>